<!DOCTYPE html>
<html>

<head>
    <style>
        .container {
            display: flex;
            flex-wrap: wrap;
        }

        .item {
            width: 33%;
            /* 或者设置固定宽度，如300px */
            border: 1px solid #eee;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="item">元素1</div>
        <div class="item">元素2</div>
        <div class="item">元素3</div>
        <div class="item">元素4</div>
        <div class="item">元素6</div>
    </div>
</body>

</html>